#ifndef UNIVERSE_H
#define UNIVERSE_H
#include "Dream.h"
#include "json/json.h"
class Universe:public QTcpServer
{
    Q_OBJECT


    static Universe* mInstance;
    Universe();
    ~Universe();
    list<Dream*> mDreams;



 public:

    static Universe* GetInstance(){return mInstance;};
    static void Create();
    static void Free();
    void incomingConnection(qintptr handle);
    void SendMessage(const std::string& data);
    void OnRequest(Json::Value& msg);
    void Check();
    QString GetAppPath(bool named);
    bool HasUser(const std::string& user);
    void SendNotif(QString type,QString sender,Json::Value& root);

};
#endif // UNIVERSE_H
